Skip to content

openssl: Add error checks for CMS_get1_certs() and CMS_get1_crls()#21957

Open
ndossche wants to merge 1 commit intophp:masterfrom
ndossche:clesss-36
Open

openssl: Add error checks for CMS_get1_certs() and CMS_get1_crls()#21957
ndossche wants to merge 1 commit intophp:masterfrom
ndossche:clesss-36

Conversation

@ndossche
Copy link
Copy Markdown
Member

@ndossche ndossche commented May 5, 2026

These allocate new stacks and add the certificates to those as clones. So these aren't trivial refcount increases and might fail. Unfortunately, an empty stack also results in a NULL return, so to distinguish an empty stack from a failure we check the error stack.

Note: this was found by an experimental static-dynamic hybrid analyser I'm developing.

These allocate new stacks and add the certificates to those as clones.
So these aren't trivial refcount increases and might fail.
Unfortunately, an empty stack also results in a NULL return, so to
distinguish an empty stack from a failure we check the error stack.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant